Assistant Tool Without User Approval PRO
Tools without approval are intended for low-risk, non-sensitive, and side-effect-free operations that the Assistant can execute immediately.
1. When to Use Tools Without Approval
Before choosing this model, you should clearly understand its boundaries.
Suitable Scenarios
Tools without approval are appropriate when the tool:
- Does not access system permissions or private user data
- Does not read or modify sensitive user information
- Does not perform irreversible or destructive operations
- Performs pure logic, computation, or deterministic transformations
Typical examples include:
- Code or text formatting
- Parsing structured data (JSON, YAML, CSV)
- Generating boilerplate or template code
- Safe and predictable edits inside the script editor
Unsuitable Scenarios
Do not use tools without approval when the tool:
- Accesses location, photos, contacts, calendar, or similar data
- Writes or overwrites user files in an irreversible way
- Triggers system dialogs or permission requests
- Produces results that are difficult for the user to anticipate
These cases should use approval-required AssistantTools (see Document 3).
2. Configuration in assistant_tool.json
For a tool that does not require approval, the configuration must explicitly declare:
Key Fields
-
requireApproval: falseIndicates that the tool will execute immediately without showing an approval dialog. -
autoApproveTypically irrelevant in this mode and can be set tofalse. -
scriptEditorOnlyDetermines whether the tool is restricted to the script editor. Whentrue, the execution function receives aScriptEditorProvider.
3. Execution Registration API
Tools without approval register a single execution function:
The corresponding function signature is:
4. Minimal Example (No Parameters)
5. Example with Parameters
Parameter Definition
Execution Logic
6. Designing the Return Message
The message field is consumed by the Assistant and should be treated as structured output rather than raw logs.
Recommended guidelines:
- The first line should summarize the result
- Avoid returning excessively large or unstructured content
- Use multi-line output or lightweight markup when structure is helpful
Examples:
or:
7. Error Handling Guidelines
- Convert all expected failures into
{ success: false, message } - Avoid throwing uncaught exceptions
- Error messages should be clear and actionable, without exposing internal details
Example:
8. Progress Reporting (Optional)
For long-running tools, progress updates can be reported via:
Use progress reporting sparingly and only at meaningful stages.
9. Using the Test Function
registerExecuteTool returns a test function that can be executed inside the script editor:
Test functions are useful for:
- Verifying parameter mapping
- Validating execution logic
- Debugging tools without triggering an Assistant conversation
10. Best Practices Summary
- “No approval” does not mean “no risk” — evaluate carefully
- Keep tool behavior deterministic and predictable
- Avoid hidden side effects
- Design output messages to support the Assistant’s next reasoning step
